package com.itboye.textileexpres.myset;

import android.app.ActionBar.LayoutParams;
import android.graphics.drawable.BitmapDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;

import com.itboye.textileexpres.R;
import com.itboye.textileexpres.base.BaseActivity;

public class ActivityCustomerDetail extends BaseActivity implements
		OnClickListener {
	TextView title;
	ImageView back, img_other;
	View pop;
	TextView cuestomer_news, all_customer;
	PopupWindow popupWindow;

	@Override
	public int initView() {
		// TODO Auto-generated method stub
		return R.layout.activity_customer_detail;
	}

	@Override
	public void onMyCreate() {
		// TODO Auto-generated method stub
		// img_other.setImageResource(R.drawable.app_loading0);
		pop = LayoutInflater.from(this).inflate(R.layout.dailog_customer, null);
		cuestomer_news = (TextView) pop.findViewById(R.id.cuestomer_news);
		all_customer = (TextView) pop.findViewById(R.id.all_customer);

	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.back:
			finish();
			break;
		case R.id.img_other:
			cuestomer_news.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Toast.makeText(ActivityCustomerDetail.this, "11",
							Toast.LENGTH_SHORT).show();
					popupWindow.dismiss();
				}
			});
			all_customer.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Toast.makeText(ActivityCustomerDetail.this, "22",
							Toast.LENGTH_SHORT).show();
					popupWindow.dismiss();
				}
			});
			popupWindow = new PopupWindow(pop, 150, LayoutParams.WRAP_CONTENT);
			popupWindow.setOutsideTouchable(true);
			popupWindow.setBackgroundDrawable(new BitmapDrawable());
			popupWindow.showAsDropDown(v);
			break;

		default:
			break;
		}
	}

}
